package c.a.a.b0.l;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.RectF;
import c.a.a.f0.c;
import c.a.a.l;
import c.a.a.q;
import c.a.a.z.c.a;
import c.a.a.z.c.p;

/* compiled from: SolidLayer */
public class h extends b {
    public final Path A;
    public final e B;
    public a<ColorFilter, ColorFilter> C;
    public final RectF x = new RectF();
    public final Paint y;
    public final float[] z;

    public h(l lVar, e eVar) {
        super(lVar, eVar);
        c.a.a.z.a aVar = new c.a.a.z.a();
        this.y = aVar;
        this.z = new float[8];
        this.A = new Path();
        this.B = eVar;
        aVar.setAlpha(0);
        aVar.setStyle(Style.FILL);
        aVar.setColor(eVar.l);
    }

    public void b(RectF rectF, Matrix matrix, boolean z) {
        super.b(rectF, matrix, z);
        RectF rectF2 = this.x;
        e eVar = this.B;
        rectF2.set(0.0f, 0.0f, (float) eVar.j, (float) eVar.k);
        this.m.mapRect(this.x);
        rectF.set(this.x);
    }

    public <T> void i(T t, c<T> cVar) {
        this.v.c(t, cVar);
        if (t != q.C) {
            return;
        }
        if (cVar == null) {
            this.C = null;
        } else {
            this.C = new p(cVar, null);
        }
    }

    public void l(Canvas canvas, Matrix matrix, int i) {
        int alpha = Color.alpha(this.B.l);
        if (alpha != 0) {
            int i2;
            a aVar = this.v.j;
            if (aVar == null) {
                i2 = 100;
            } else {
                i2 = ((Integer) aVar.e()).intValue();
            }
            i = (int) (((((((float) alpha) / 255.0f) * ((float) i2)) / 100.0f) * (((float) i) / 255.0f)) * 255.0f);
            this.y.setAlpha(i);
            a aVar2 = this.C;
            if (aVar2 != null) {
                this.y.setColorFilter((ColorFilter) aVar2.e());
            }
            if (i > 0) {
                float[] fArr = this.z;
                fArr[0] = 0.0f;
                fArr[1] = 0.0f;
                e eVar = this.B;
                int i3 = eVar.j;
                fArr[2] = (float) i3;
                fArr[3] = 0.0f;
                fArr[4] = (float) i3;
                int i4 = eVar.k;
                fArr[5] = (float) i4;
                fArr[6] = 0.0f;
                fArr[7] = (float) i4;
                matrix.mapPoints(fArr);
                this.A.reset();
                Path path = this.A;
                fArr = this.z;
                path.moveTo(fArr[0], fArr[1]);
                path = this.A;
                fArr = this.z;
                path.lineTo(fArr[2], fArr[3]);
                path = this.A;
                fArr = this.z;
                path.lineTo(fArr[4], fArr[5]);
                path = this.A;
                fArr = this.z;
                path.lineTo(fArr[6], fArr[7]);
                path = this.A;
                fArr = this.z;
                path.lineTo(fArr[0], fArr[1]);
                this.A.close();
                canvas.drawPath(this.A, this.y);
            }
        }
    }
}
